package cn.stylefeng.guns.modular.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.modular.entity.Frame;
import cn.stylefeng.guns.modular.entity.Schedule;
import cn.stylefeng.guns.modular.entity.Scheduleitem;
import cn.stylefeng.guns.modular.mapper.ShareFrameAndScheduleMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Map;

/**
 * @author third_e
 * @create 2020/1/2 0002-下午 7:30
 */
@Service
public class ShareFrameAndScheduleService extends ServiceImpl<ShareFrameAndScheduleMapper, Object> {


    public Page<Map<String, Object>> getShareFrameInfo(String otherOrmyself, String nameOrcontent,Long userId){
        Page page = LayuiPageFactory.defaultPage();
        return this.baseMapper.getShareFrameInfo(page,otherOrmyself,nameOrcontent,userId);
    }

    public Page<Map<String,Object>> getShareScheduleInfo(String otherOrmyself, String nameOrcontent, String beginTime, String endTime, Long userId){
        Page page = LayuiPageFactory.defaultPage();
        return this.baseMapper.getShareScheduleInfo(page, otherOrmyself, nameOrcontent, beginTime, endTime,userId);
    }


    public Collection<Frame> getOtherFrameInfo(Long userId){
        return this.baseMapper.getOtherFrameInfo(userId);
    }

    public Collection<Schedule> getOtherScheduleInfo(Long userId){
        return this.baseMapper.getOtherScheduleInfo(userId);
    }

    public Schedule getScheduleAndFrameitem(Long scheduleId){
        return this.baseMapper.getScheduleAndFrameitem(scheduleId);
    }

    public Collection<Scheduleitem> getShareScheduleitemInfo(Long scheduleId, String startDate, String endDate){
        return this.baseMapper.getShareScheduleitemInfo(scheduleId, startDate, endDate);
    }
}
